<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/view/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>个人任务</title>
 
<link
	href="${ctxStatic}/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css"
	rel="stylesheet" type="text/css" />
<!-- END GLOBAL MANDATORY STYLES -->
<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
<link href="${ctxStatic}/assets/global/plugins/jqvmap/jqvmap/jqvmap.css"
	rel="stylesheet" type="text/css" />
<!-- END PAGE LEVEL PLUGIN STYLES -->
<!-- BEGIN PAGE STYLES -->
<link href="${ctxStatic}/assets/admin/pages/css/tasks.css"
	rel="stylesheet" type="text/css" />
<!-- END PAGE STYLES -->
<!-- BEGIN THEME STYLES -->
<link href="${ctxStatic}/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css" />
<link href="${ctxStatic}/assets/global/css/plugins.css" rel="stylesheet"
	type="text/css" />
<link href="${ctxStatic}/assets/admin/layout/css/layout.css"
	rel="stylesheet" type="text/css" />
<link href="${ctxStatic}/assets/admin/layout/css/themes/darkblue.css"
	rel="stylesheet" type="text/css" id="style_color" />
<link href="${ctxStatic}/assets/admin/layout/css/custom.css"
	rel="stylesheet" type="text/css" />
<link href="${ctxStatic}/assets/admin/pages/css/profile.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/datatables/datatables.min.css"
	rel="stylesheet" type="text/css" />
<link
	href="${ctxStatic}/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css"
	rel="stylesheet" type="text/css" />
</head>
<body>
	<!-- BEGIN CONTENT -->
	<div class="">
		<!-- BEGIN CONTENT BODY -->
		<div class="page-content" style="height: 700px;">
			<!-- BEGIN PAGE HEADER-->
			<!-- BEGIN THEME PANEL -->
			<!-- END THEME PANEL -->
			<!-- BEGIN PAGE BAR -->
			<div class="portlet-title tabbable-line">
				<div class="caption caption-md">
					<i class="icon-globe theme-font hide"></i> <span
						class="caption-subject font-blue-madison bold uppercase">账户管理</span>
				</div>
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab_1_1" data-toggle="tab">待办任务</a>
					</li>
					<li><a href="#tab_1_2" data-toggle="tab">已办任务</a></li>
					<li><a href="#tab_1_3" data-toggle="tab">申请任务</a></li>
				</ul>
			</div>
			<div class="portlet-body">
				<div class="tab-content">
					<!-- PERSONAL INFO TAB -->
					<div class="tab-pane active" id="tab_1_1">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box green">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-cogs"></i>待办任务
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse" data-original-title=""
										title=""> </a> <a href="#portlet-config" data-toggle="modal"
										class="config" data-original-title="" title=""> </a> <a
										href="javascript:;" class="reload" data-original-title=""
										title=""> </a> <a href="javascript:;" class="remove"
										data-original-title="" title=""> </a>
								</div>
							</div>

							<div class="portlet-body">
								<div class="table-toolbar">
									<div class="row">
										<div class="col-md-6">
											<div class="btn-group"></div>
										</div>
										<div class="col-md-6"></div>
									</div>
								</div>
								<table class="table table-striped table-hover table-bordered"
									id="sample_editable_1">
									<thead>
										<tr>
											<th>假种</th>
											<th>申请人</th>
											<th>申请时间</th>
											<th>开始时间</th>
											<th>结束时间</th>
											<th>当前节点</th>
											<th>任务创建时间</th>
											<th>流程状态</th>
											<th>待办类型</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>

										<c:forEach items="${page.result }" var="leave">
											<c:set var="task" value="${leave.task }" />
											<c:set var="pi" value="${leave.processInstance }" />
											<tr id="${leave.id }" tid="${task.id }">
												<td>${leave.leaveType }</td>
												<td>${leave.userId }</td>
												<td>${leave.applyTime }</td>
												<td>${leave.startTime }</td>
												<td>${leave.endTime }</td>
												<td><a class="trace" href='#' pid="${pi.id }"
													pdid="${pi.processDefinitionId}" title="点击查看流程图">${task.name }</a>
												</td>
												<%--<td><a target="_blank" href='${ctx }/workflow/resource/process-instance?pid=${pi.id }&type=xml'>${task.name }</a></td> --%>
												<td>${task.createTime }</td>
												<td>${pi.suspended ? "已挂起" : "正常" }；<b title='流程版本号'>V:
														${leave.processDefinition.version }</b></td>
														<td>${task.category }</td>
												<td><c:if test="${empty task.assignee }">
														<a class="claim"
															href="${ctx }/oa/leave/task/claim/${task.id}">签收</a>
													</c:if> <c:if test="${not empty task.assignee }">
														<%-- 此处用tkey记录当前节点的名称 --%>
													<%-- 	<a class="handle" tkey='${task.taskDefinitionKey }'
															tname='${task.name }' href="#">办理</a> --%>
															<a class="handle" href="${ctx }/oa/leave/detail/${leave.id }">办理</a>
													<%-- 	<a href="${ctx }/act/task/rollBack/${task.id}">驳回</a>
														<a href="${ctx }/act/task/rollBackByTaskKey/${task.id}/${userTaskKey}">回退到usertask1</a>
														<a href="${ctx }/act/task/delegateTask/${task.id}/hp003">委派hp003</a>
														 <a href="${ctx }/oa/leave/communicate/${task.id}/hp003">沟通</a> --%>
														 <a href="${ctx }/oa/leave/communicate/${task.id}/hp003">沟通</a> 
													</c:if></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
					<div class="tab-pane active" id="tab_1_2">
						<!-- BEGIN EXAMPLE TABLE PORTLET-->
						<div class="portlet box green">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-cogs"></i>已办任务
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse" data-original-title=""
										title=""> </a> <a href="#portlet-config" data-toggle="modal"
										class="config" data-original-title="" title=""> </a> <a
										href="javascript:;" class="reload" data-original-title=""
										title=""> </a> <a href="javascript:;" class="remove"
										data-original-title="" title=""> </a>
								</div>
							</div>

							<div class="portlet-body">
								<div class="table-toolbar">
									<div class="row">
										<div class="col-md-6">
											<div class="btn-group"></div>
										</div>
										<div class="col-md-6"></div>
									</div>
								</div>
								<table class="table table-striped table-hover table-bordered"
									id="sample_editable_1">
									<thead>
										<tr>
											<th>申请人</th>
											<th>指定办理人</th>
											<th>任务名称</th>
											<th>流程实例ID</th>
											<th>流程DefID</th>
											<th>任务创建时间</th>
											<th>任务过期时间</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>

										<c:forEach items="${doneList}" var="doneAct">
											<tr>
												<td></td>
												<td>${doneAct.assignee}</td>
												<td>${doneAct.name }</td>
												<td>${doneAct.processInstanceId}</td>
												<td>${doneAct.processDefinitionId}</td>
												<td>${doneAct.createTime}</td>
												<td>${doneAct.dueDate}</td>
												<td><a href="">详情</a></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
					<div class="tab-pane active" id="tab_1_3">
					<table class="table table-striped table-hover table-bordered"
									id="sample_editable_1">
									<thead>
										<tr>
											<th>假种</th>
											<th>申请人</th>
											<th>申请时间</th>
											<th>开始时间</th>
											<th>结束时间</th>
											<th>当前节点</th>
											<th>任务创建时间</th>
											<th>流程状态</th>
											<th>待办类型</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${page2.result }" var="leave2">
											<c:set var="task" value="${leave2.task }" />
											<c:set var="pi" value="${leave2.processInstance }" />
											<tr id="${leave2.id }" tid="${task.id }">
												<td>${leave2.leaveType }</td>
												<td>${leave2.userId }</td>
												<td>${leave2.applyTime }</td>
												<td>${leave2.startTime }</td>
												<td>${leave2.endTime }</td>
												<td><a class="trace" href='#' pid="${pi.id }"
													pdid="${pi.processDefinitionId}" title="点击查看流程图">${task.name }</a>
												</td>
												<%--<td><a target="_blank" href='${ctx }/workflow/resource/process-instance?pid=${pi.id }&type=xml'>${task.name }</a></td> --%>
												<td>${task.createTime }</td>
												<td>${pi.suspended ? "已挂起" : "正常" }；<b title='流程版本号'>V:
														${leave.processDefinition.version }</b></td>
														<td>${task.category }</td>
												<td> <a href="#myModal1" id="btnresp" onclick="respMsg('${task.id}','${pi.id }');"  role="button"  class="btn blue" data-toggle="modal">
							反馈 </a>
													 </td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
                </div>
				</div>
			</div>
			<!-- END CONTENT BODY -->
		</div>
		<!-- END CONTENT -->
		<!-- 反馈 对话框-->
				<form role="form" action="${ctx}/oa/leave/comment" method="post" class="form-horizontal">
						<div id="myModal1" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true" style="display: none;">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
											<h4 class="modal-title">反馈意见</h4>
										</div>
										<div class="modal-body">
												<div class="form-group form-md-line-input has-success">
										<label class="col-md-2 control-label" for="form_control_1">内容：</label>
										<div class="col-md-10">
										<input type="hidden"  id="processInstanceId" name="processInstanceId" value="ss"/> 
										<input type="hidden"  id="taskId" name="taskId" value="taskid"/> 
											<textarea id="msg" name="msg" class="form-control" rows="3" placeholder="输入反馈内容"></textarea>
									 
										</div>
									</div>
										</div>
										<div class="modal-footer">
											<button class="btn yellow" type="submit">提交反馈</button>
											<button class="btn default" data-dismiss="modal" aria-hidden="true">关闭</button>
										</div>
									</div>
								</div>
							</div>
							</form>
</div>


		<!-- BEGIN CORE PLUGINS -->
		<!--[if lt IE 9]>
<script src="../../assets/global/plugins/respond.min.js"></script>
<script src="../../assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
		<script src="${ctxStatic}/assets/global/plugins/jquery.min.js"
			type="text/javascript"></script>
		<script src="${ctxStatic}/assets/global/plugins/jquery-migrate.min.js"
			type="text/javascript"></script>
		<!-- IMPORTANT! Load jquery-ui.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
		<script
			src="${ctxStatic}/assets/global/plugins/jquery-ui/jquery-ui.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/bootstrap/js/bootstrap.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
			type="text/javascript"></script>
		<script src="${ctxStatic}/assets/global/plugins/jquery.blockui.min.js"
			type="text/javascript"></script>
		<script src="${ctxStatic}/assets/global/plugins/jquery.cokie.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/uniform/jquery.uniform.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js"
			type="text/javascript"></script>
		<script src="${ctxStatic}/assets/global/scripts/datatable.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/datatables/datatables.min.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js"
			type="text/javascript"></script>
		<script
			src="${ctxStatic}/assets/admin/pages/scripts/table-datatables-editable.min.js"
			type="text/javascript"></script>
		<!-- END CORE PLUGINS -->
		<!-- BEGIN PAGE LEVEL PLUGINS -->
		<script
			src="${ctxStatic}/assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js"
			type="text/javascript"></script>
		<!-- END PAGE LEVEL PLUGINS -->

		<!-- BEGIN PAGE LEVEL SCRIPTS -->

		<!-- END PAGE LEVEL SCRIPTS -->
			<script>
	 
		function respMsg(taskid,pid){
			 $("#taskId").val(taskid);
			 $("#processInstanceId").val(pid);
		}
		</script>
</body>
</html>